The FocusTracker keeps track of the currently focused window using its
internal this._currentWindow property. It will only pick up the focused
window though when receiving a "notify::focus-window" signal, so the
focused window that's set when the FocusTracker is created won't be
picked up.
Fix that by setting the _currentWindow during creation of the
FocusTracker.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1728>
var FocusTracker = class {
constructor() {
- this._currentWindow = null;
this._rect = null;
this._notifyFocusId = global.display.connect('notify::focus-window', () => {
this.emit('window-changed', this._currentWindow);
});
+ this._setCurrentWindow(global.display.focus_window);
+
this._grabOpBeginId = global.display.connect('grab-op-begin', (display, window, op) => {
if (window == this._currentWindow &&
(op == Meta.GrabOp.MOVING || op == Meta.GrabOp.KEYBOARD_MOVING))